package uk.co.agileworks.bidpirate.service;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

import uk.co.agileworks.bidpirate.test.DataSet;

@ContextConfiguration(locations = "file:src/main/webapp/WEB-INF/spring-servlet.xml")
public final class EbaySessionIT extends AbstractJUnit4SpringContextTests {

	@Autowired
	private EbaySession ebaySession;

	private DataSet testData = new DataSet();

	@Test
	public void signInAndOut() {
		assertTrue(ebaySession.signIn(testData.getUser1()));
		assertTrue(ebaySession.isSignedIn());
		ebaySession.signOut();
		assertFalse(ebaySession.isSignedIn());
	}

}
